package com.zheng.zk;


import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.retry.ExponentialBackoffRetry;

public class Curator {


    public static CuratorFramework getCuratorFramework(){
        CuratorFramework curator= CuratorFrameworkFactory.builder()
                .connectString("127.0.0.1:2181")
                .sessionTimeoutMs(3000)
                .retryPolicy(new ExponentialBackoffRetry(1000,3))
                .connectionTimeoutMs(3000)
                .namespace("base")
                .build();
        curator.start();
        return curator;
    }
}
